home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / H-K / KeMo Lib 1.5 / KeMo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-22  |  3.6 KB  |  120 lines  |  [TEXT/KAHL]

  1. /*
  2.  *  KeMo.h
  3.  *
  4.  *  Copyright (c) 1992,1993 Dan Costin.  All rights reserved.
  5.  *
  6.  */
  7.  
  8. #define KeMoAllDevs        0x0001        /* flags for KeMoSelect */
  9. #define KeMoDev2        0x0004
  10. #define KeMoKey            0x0004
  11. #define KeMoDev3        0x0008
  12. #define KeMoMouse         0x0008
  13. #define KeMoDev4        0x0010
  14. #define KeMoTablet        0x0010
  15. #define KeMoDev8        0x0100
  16. #define KeMoDev9        0x0200
  17. #define KeMoDevA        0x0400
  18. #define KeMoDevB        0x0800
  19. #define KeMoDevC        0x1000
  20. #define KeMoDevD        0x2000
  21. #define KeMoDevE        0x4000
  22. #define KeMoDevF        0x8000
  23. #define KeMoOneKey        0x00010000
  24. #define KeMoAllKeys        0x00020000
  25. #define KeMoOneMouse    0x00040000
  26. #define KeMoAllMice        0x00080000
  27.  
  28. #define KeMoDown        0x00        /* flags and transitions for KeMoWait */
  29. #define KeMoUp            0x01
  30. #define KeMoUpDown        0x02
  31. #define KeMoTimedOut    0x04
  32.  
  33. #define KeMoNoTimeOut     -1L            /* no timeout for KeMoWait */
  34.  
  35. #define KeMoQuiet        0x0001        /* flags for KeMoInit */
  36. #define KeMoNoAlert        0x0002
  37. #define KeMoAltKeys        0x0004
  38. #define KeMoNoKeys        0x0008
  39. #define KeMoNoTimer        0x0010
  40. #define KeMoNoSync        0x0020
  41. #define KeMoNoTCheck    0x0040
  42. #define KeMoNoCorrection    0x0080    /* flag for KeMoTimerStop */
  43. #define KeMoNoMBarInit    0x0100
  44. #define KeMoAvoidSysHeap    0x0200        /* use this flag if Synch initialization
  45.                                             freezes up your 68040 or later */
  46.  
  47. #define KeMoErrorVeryOldSystem         -501    /* errors */
  48. #define KeMoErrorOldSystem             -502
  49. #define KeMoErrorNotADB             -503
  50. #define KeMoErrorNotInitialized        -504
  51. #define KeMoErrorBadArgs            -505
  52. #define KeMoErrorUnsuccessful        -506
  53. #define KeMoErrorNoSuchDevice        -507
  54. #define KeMoErrorTimerRunning        -508
  55. #define KeMoErrorTimerNotRunning    -509
  56. #define KeMoErrorTimerNotInit        -510
  57. #define KeMoErrorTimerOff            -511
  58. #define KeMoErrorImproperTest        -512
  59. #define KeMoErrorNoHeapAlloc        -513
  60. #define KeMoErrorNoSync                -514
  61. #define KeMoErrorGestalt            -515
  62. #define KeMoErrorNoCorrection        -516
  63. #define KeMoErrorUnknownDevType        -517
  64. #define KeMoErrorOneDevOnly            -518
  65. #define KeMoErrorMBarHidden            -519
  66. #define KeMoErrorMBarShows            -520
  67. #define KeMoNotPressed                -521
  68.  
  69. #define KeMoErrorMisc                -599
  70.  
  71.     /* definitions for the more arbitrary ASCII codes returned by KeMoCode2Asc */
  72.                         
  73. enum { K0 = 0, K1, K2, K3, K4, K5, K6, K7, K8, K9,
  74.         F1 = 11, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15,
  75.         KSLASH = 'A', TAB, COMMAND, DELETE, ESC, /* NO F */
  76.         POWER = 'G', HELP, /* NO I OR J */
  77.         KENTER = 'K', CAPS, KMINUS, NUMCLEAR, OPTIONL, KPERIOD, KEQUAL,
  78.         RETURN, SHIFTL, CTLL, PGUP, DOWN, PGDOWN, DEL, HOME, END,
  79.         LEFT = '<', RIGHT = '>', UP = '^',
  80.         SHIFTR = '@', CTLR = '#', OPTIONR = '$'
  81.     };
  82.  
  83.             /* structure whose address is to be sent to KeMoWait */
  84. typedef struct {
  85.     char key, key2;
  86.     char updown, updown2;
  87.     } KeMoParms;
  88.     
  89.             /* function prototypes */
  90. pascal long KeMoInit(short flags);
  91. pascal long KeMoSelect(long flags);
  92. pascal long KeMoReset(void);
  93. pascal long KeMoAccuracy(void);
  94. pascal long KeMoWait(short flags, long timeout, KeMoParms *parms);
  95. pascal long KeMoDelay(long timeout);
  96. pascal long KeMoTimerTest(void);
  97. pascal long KeMoSetDeviceType(short devnum, short flags);
  98.  
  99. pascal long KeMoSync(short when);
  100.  
  101. pascal long KeMoTimerStart(void);
  102. pascal long KeMoTimerStop(short flags);
  103.  
  104. pascal short KeMoCode2Asc(short code);
  105.  
  106. pascal long KeMoHideMBar(void);
  107. pascal long KeMoShowMBar(void);
  108.  
  109. pascal long KeMoQuitAllApps(void);
  110.  
  111. /* available globals, set-up by calling KeMoInit() */
  112.             /* KeMoDevArray: each position is 1 if there's a device at that address,
  113.                     0 otherwise, index from 0 to 15 */
  114. extern char KeMoDevArray[], 
  115.             /* KeMoDevType: each position has the original ADB device handler ID 
  116.                     for the device: usually 2 or 3 for keyboards, 1 for mouse,
  117.                     index from 0 to 15 */
  118.              KeMoDevType[];
  119.  
  120.